package com.cashmama.market.api.infras.enums.order;

/**
 * @program: cashmama-api
 * @description
 * @author: frank
 * @create: 2020-04-07 11:43
 **/
public enum RepaymentQueryStatusEnum {

    HANDING(0, "HANDING"),
    PARTIAL(1, "SUCCESS"),
    SUCCESS(2, "SUCCESS");

    private Integer code;
    private String msg;


    RepaymentQueryStatusEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public RepaymentQueryStatusEnum setCode(Integer code) {
        this.code = code;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public RepaymentQueryStatusEnum setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public static RepaymentQueryStatusEnum getByCode(Integer code){
        if(code == null){
            return null;
        }
        for(RepaymentQueryStatusEnum repaymentQueryStatusEnum : RepaymentQueryStatusEnum.values()){
            if(code == repaymentQueryStatusEnum.getCode()){
                return repaymentQueryStatusEnum;
            }
        }
        return null;
    }

}
